package jvm.shk;

public class ClassLoaderDemo extends ClassLoader {

    public static void main(String[] args) {
        /** appClassLoader加载器 */
        ClassLoader systemClassLoader = ClassLoader.getSystemClassLoader();
        System.out.println(systemClassLoader); //sun.misc.Launcher$AppClassLoader@18b4aac2

        /** 扩展类加载器 */
        ClassLoader parent = systemClassLoader.getParent();
        System.out.println(parent); //sun.misc.Launcher$ExtClassLoader@119d7047

        /** 引导类加载器 */
        ClassLoader parent1 = parent.getParent();
        System.out.println(parent1);//null

        /** 查看用户自定义类使用的类加载器是什么 */
        ClassLoader classLoader = ClassLoaderDemo.class.getClassLoader();
        System.out.println(classLoader); //sun.misc.Launcher$AppClassLoader@18b4aac2
    }


}
